<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:replace="top::html"/> <!-- 引入样式 -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>专家详情页面</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<body class="fixed hold-transition skin-blue">

	<div class="wrapper">
	
		<!-- 引入表头 -->
		<div th:replace="tophtml::html"></div>
		<!-- 引入左边 -->
		<div th:replace="left::html"></div>

		<!-- 右侧修改功能 -->
		<div class="content-wrapper">
			<!-- 页眉 -->
			<section class="content-header">
				<div class="audit_k">
					<span>专家详细信息</span>
					<a style="margin-left: 10px;" href="javascript:void(0);selectAnchor('anchor1');" onclick="document.getElementById('anchor1').scrollIntoView()" >已匹配需求</a>
					<a style="margin-left: 10px;" href="javascript:void(0);selectAnchor('anchor2');" onclick="document.getElementById('anchor2').scrollIntoView()" >参会情况</a>
					<a style="margin-left: 10px;" href="javascript:void(0);selectAnchor('anchor3');" onclick="document.getElementById('anchor3').scrollIntoView()" >未匹配需求</a>
				</div>
				<ol class="breadcrumb">
					<li><a href="/index"><i class="fa fa-dashboard"></i>用户中心</a></li>
					<li><a href="/person/findPersonList">专家管理</a></li>
					<li><a th:href="@{/person/personDetails(pid=${person.pid})}">专家详细信息</a></li>
				</ol>
			</section>
			<section class="content container-fluid">
				<!-- 右侧列表部分 -->
				<table class="table table-bordered" id="details">
					<tbody>
						<tr>
							<td><label>专家ID：</label></td>
							<td th:text="'E'+*{person.expertNumber}"></td>
							<td><label>姓名：</label></td>
							<td th:text="*{person.name}"></td>
						</tr>
						<tr>
							<td><label>邮箱：</label></td>
							<td th:text="*{not #strings.isEmpty(person.email)} ? '****' + *{#strings.substring(person.email, 4, #strings.length(person.email))}"></td>
							<td><label>微信：</label></td>
							<td th:text="*{not #strings.isEmpty(person.wechat)} ? *{#strings.substring(person.wechat, 0, #strings.length(person.wechat)-4)} + '****'"></td>
						</tr>
						<tr>
							<td><label>籍贯：</label></td>
							<td th:text="*{person.birthPlace}"></td>
							<td><label>最高学历：</label></td>
							<td th:text="*{person.maxEducation}"></td>
						</tr>
						<tr>
							<td><label>固定电话：</label></td>
							<td th:text="*{not #strings.isEmpty(person.fixedPhone)} ? *{#strings.substring(person.fixedPhone, 0, #strings.length(person.fixedPhone)-4)} + '****'"></td>
							<td><label>手机：</label></td>
							<td th:text="*{not #strings.isEmpty(person.tell)} ? *{#strings.substring(person.tell, 0, #strings.length(person.tell)-4)} + '****'"></td>
						</tr>
						<tr>
							<td><label>毕业院校及所学专业：</label></td>
							<td th:text="*{person.schoolAndMajor}"></td>
							<td><label>单位：</label></td>
							<td th:text="*{person.unit}"></td>
						</tr>
						<tr>
							<td><label>职务(职称)：</label></td>
							<td th:text="*{person.title}"></td>
							<td><label>专业领域：</label></td>
							<td th:text="*{person.professionaField}"></td>
						</tr>
						<tr>
							<td><label>其他联系方式：</label></td>
							<td th:text="*{not #strings.isEmpty(person.otherContact)} ? *{#strings.substring(person.otherContact, 0, #strings.length(person.otherContact)-4)} + '****'"></td>
							<td><label>教育背景：</label></td>
							<td th:text="*{person.education}"></td>
						</tr>
						<tr>
							<td><label>工作经历：</label></td>
							<td th:text="*{person.workExp}"></td>
							<td><label>荣誉奖励：</label></td>
							<td th:text="*{person.honorAward}"></td>
						</tr>
						<tr>
							<td><label>科技成果：</label></td>
							<td th:text="*{person.technica}"></td>
							<td><label>专家类型：</label></td>
							<td th:text="*{person.typeWorth}"></td>
						</tr>
						<tr>
							<td><label>专家来源：</label></td>
							<td th:text="*{person.sourceWorth}"></td>
							<td><label>所属领域：</label></td>
							<td th:text="*{person.researchField}"></td>
						</tr>
						<tr>
							<td><label>国内国外：</label></td>
							<td th:text="*{person.domesticOrForeign == 0 ? '国内' : '国外'}"></td>
							<td><label>所在地区：</label></td>
							<td th:text="*{person.areaWorth}"></td>
						</tr>
						<tr>
							<td><label>人才级别：</label></td>
							<td th:text="*{person.talentLevel}"></td>
							<td><label>附件：</label></td>
							<td >
           						<a  th:if="${person.annex}" th:href="@{'/person/downloadPerson?fileName='+${person.annex}}">专家附件</a>
           					</td>
						</tr>
						<tr>
							<td><label>性别：</label></td>
							<td th:if="*{person.sex == 0}">男</td>
							<td th:if="*{person.sex == 1}">女</td>
							<td th:if="*{person.sex != 0 && person.sex != 1}"></td>
							<td><label>出生日期：</label></td>
							<td th:text="*{person.birth}"></td>
						</tr>
						<tr>
							<td><label>备注1：</label></td>
							<td th:text="*{person.remark1}"></td>
							<td><label>备注2：</label></td>
							<td th:text="*{person.remark2}"></td>	
						</tr>
						<tr>
							<td><label>收集人(录入人)：</label></td>
							<td th:text="*{user.fullName}"></td>
							<td><label>录入时间：</label></td>
							<td th:text="*{person.entryTime}"></td>
						</tr>
					</tbody>
				</table>
            	<!-- 已匹配需求 -->
				<div class="menuTitle2">
					<span><a th:name="anchor1" id="anchor1" style="">已匹配需求</a></span>
					<span><a th:href="@{/person/findButtDetailsList(pid=${person.pid})}" style="color: #ff3300;font-weight: bold">More &gt;&gt;</a></span>
				</div>
				<div class="menuContent2">
					<div class="outside_t" style="margin: 10px 0 0 0">
						<table id="person" class="table table-bordered">
							<tbody>
								<tr>
									<th>对接介绍</th>
					                <th>负责人</th>
					                <th>对接时间</th>
					                <th>对接状态</th>
					                <th>对接详情</th>
					                <th>对接附件</th>
					                <th>操作</th>
								</tr>
								<tr th:each="collect,iterStat : ${pageInfo1.list}">
									<td>
						                <p style="font-weight:normal;" th:text="${collect.expertName}"></p>
						                <!-- 需求名称 -->
						                <p style="font-weight:normal;">
						                	<div class="col-md-4" style="width:100%;font-size: 14px;">
										    	<div class="box box-default collapsed-box" style="border-top:0px solid #d2d6de;">
											    	<div class="box-header with-border" th:if="${collect.demandName != null}">
												    	<span th:if="${#strings.length(collect.demandName) > 15}">
												        	<span th:text="${#strings.substring(collect.demandName,0,15)+'...'}"></span>
												        </span>
												        <span th:unless="${#strings.length(collect.demandName) > 15}">
												        	<span th:text="${collect.demandName}"></span>
												        </span>
												        <div class="box-tools pull-right" th:if="${#strings.length(collect.demandName) > 15}">
												        	<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>
												        </div>
											       	</div>
											        <div class="box-body" style="display: none;">
											            <span th:text="${collect.demandName}"></span>
											        </div>
										    	</div>
								    		</div>
						                </p>
						                <p style="font-weight:normal;" th:text="${collect.projectName}"></p>
						                <p style="font-weight:normal;" th:text="${collect.customerName}"></p>
						                <p style="font-weight:normal;" th:text="${collect.confName}"></p>
						            </td>
						            <td th:text="${collect.buttName}"></td>
						            <td th:text="${collect.buttDataTime}"></td>
					                <td th:if="${collect.buttStatus==1}">沟通对接需求</td>
					               	<td th:if="${collect.buttStatus==2}">已签合作协议</td>
					                <td th:if="${collect.buttStatus==3}">执行对接任务</td>
					                <td th:if="${collect.buttStatus==4}">完成对接需求</td>
					                <!-- 对接详情 -->
                					<td>
										<div class="col-md-3" style="width:100%;font-size: 14px;">
									    	<div class="box box-default collapsed-box" style="border-top:0px solid #d2d6de;">
										    	<div class="box-header with-border">
											    	<span th:if="${#strings.length(collect.buttDetails)>30}">
											        	<span th:text="${#strings.substring(collect.buttDetails,0,30)+'......'}"></span>
											        </span>
											        <span th:unless="${#strings.length(collect.buttDetails)>30}">
											        	<span th:text="${collect.buttDetails}"></span>
											        </span>
											        <div class="box-tools pull-right" th:if="${#strings.length(collect.buttDetails)>30}">
											        	<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>
											        </div>
										       	</div>
										        <div class="box-body" style="display: none;">
										            <span th:text="${collect.buttDetails}"></span>
										        </div>
									    	</div>
								        </div>
                					</td>
                					<td >
                						<a  th:if="${collect.buttaNnex}" th:href="@{'/person/download?fileName='+${collect.buttaNnex}}">对接附件</a>
                					</td>
               	  					<td>
               	  						<a th:href="@{/person/findHistoryButtDetails(pid=${collect.pid})}">查看历史详情</a>|
               	  						<a th:href="@{/person/addDetailsView(pid=${collect.pid})}">添加对接详情</a>
               	  					</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
	        	<!-- 参会情况 -->
				<div class="menuTitle2">
					<span><a th:name="anchor2" id="anchor2" style="">参会情况</a></span>
					<span><a th:href="@{/person/mateConference(pid=${person.pid})}" style="color: #ff3300;font-weight: bold">More &gt;&gt;</a></span>
				</div>
				<div class="menuContent2">
					<div class="outside_t" style="margin: 10px 0 0 0">
						<table class="table table-bordered">
							<tbody>
								<tr>
									<th>活动Id</th>
									<th>活动名称</th>
									<th>开始时间</th>
								    <th>结束时间</th>
									<th>所属领域</th>
									<th>所在地区</th>
								</tr>
								<tr th:each="conference,conferenceIndex : ${pageInfo.list}">
									<td title="查看会议详情">
                                        <a th:href="@{'/conference/showDetail?conferenceId='+${conference.pid}}" th:text="'A'+${conference.conferenceNumber}"></a>
                                    </td>
									<!-- 活动名称 -->
									<td>
										<div class="col-md-4" style="width:100%;font-size: 14px;">
									    	<div class="box box-default collapsed-box" style="border-top:0px solid #d2d6de;">
										    	<div class="box-header with-border" th:if="${conference.conferenceName != null}">
											    	<span th:if="${#strings.length(conference.conferenceName) > 15}">
											        	<a th:href="${conference.conferenceWebSite}" th:text="${#strings.substring(conference.conferenceName,0,15)+'...'}" target="_blank"></a>
											        </span>
											        <span th:unless="${#strings.length(conference.conferenceName) > 15}">
											        	<a th:href="${conference.conferenceWebSite}" th:text="${conference.conferenceName}" target="_blank"></a>
											        </span>
											        <div class="box-tools pull-right" th:if="${#strings.length(conference.conferenceName) > 15}">
											        	<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>
											        </div>
										       	</div>
										        <div class="box-body" style="display: none;">
										            <a th:href="${conference.conferenceWebSite}" th:text="${conference.conferenceName}" target="_blank"></a>
										        </div>
									    	</div>
								    	</div>
                					</td>
									<td th:text="${conference.conferenceDateTime}"></td>
									<td th:text="${conference.conferenceBeginTime}"></td>
									<!-- 所属领域 -->
									<td>
										<div class="col-md-4" style="width:100%;font-size: 14px;">
									    	<div class="box box-default collapsed-box" style="border-top:0px solid #d2d6de;">
										    	<div class="box-header with-border" th:if="${conference.researchFieldNameStr != null}">
											    	<span th:if="${#strings.length(conference.researchFieldNameStr) > 15}">
											        	<span th:text="${#strings.substring(conference.researchFieldNameStr,0,15)+'...'}"></span>
											        </span>
											        <span th:unless="${#strings.length(conference.researchFieldNameStr) > 15}">
											        	<span th:text="${conference.researchFieldNameStr}"></span>
											        </span>
											        <div class="box-tools pull-right" th:if="${#strings.length(conference.researchFieldNameStr) > 15}">
											        	<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>
											        </div>
										       	</div>
										        <div class="box-body" style="display: none;">
										            <span th:text="${conference.researchFieldNameStr}"></span>
										        </div>
									    	</div>
								        </div>
									</td>
									<td th:attr="title=${conference.areaNameStr}" th:text="${conference.areaNameArray}"></td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<!-- 未匹配需求 -->
				<div class="menuTitle2">
					<span><a th:name="anchor3" id="anchor3" style="">未匹配需求</a> </span>
					<span><a th:href="@{'/person/mateDemandView?pid='+${person.pid}+'&expertNumber='+${person.expertNumber}+'&name='+${person.name}}" 
							 style="color: #ff3300;font-weight: bold">More &gt;&gt;</a>
					</span>
				</div>
				<div class="menuContent2">
					<div class="outside_t" style="margin: 10px 0 0 0">
						<div class="box-header with-border">
							<h3 class="box-title">
								<button class="btn btn-primary" id="dosubmit">匹配</button>
								<label style="margin-left: 28.2px;font-weight: lighter;">专家姓名</label> 
								<a th:href="@{/person/findPersonList(pid=${person.pid})}" th:text="${person.name}" class="form-control" style="width: 202px;margin-left: 163px;margin-top: -36px;"></a>
							</h3>
						</div>
						<table class="table table-bordered">
							<tbody>
								<tr>
									<th><input id="all" type="checkbox" th:disabled="${not #lists.isEmpty(buttedDemandIdList)}" /></th>
									<th>需求id</th>
									<th>需求名称</th>
                                    <th>需求类型</th>
                                    <th>需求状态</th>
                                    <th>需求联系人</th>
								</tr>
								<tr th:each="demand : ${pageInfo2.list}">
									<td>
										<input type="checkbox" class="matched" th:disabled="${#lists.contains(buttedDemandIdList, demand.demandId)}" 
											   th:value="'demandId='+${demand.demandId}+'&demandName='+${demand.demandName}+
											   '&personId='+${person.pid}+'&expertNumber='+${person.expertNumber}+'&name='+${person.name}" />
									</td>
									<td title="查看需求详情">
                                        <a th:href="@{'/demand/showDetail?demandId='+${demand.demandId}}" th:text="${demand.demandNumber}"></a>
                                    </td>
                                    <td width="35%">
                                    	<div class="col-md-4" style="width:100%;font-size: 14px;">
									    	<div class="box box-default collapsed-box" style="border-top:0px solid #d2d6de;">
										    	<div class="box-header with-border" th:if="${demand.demandName != null}">
											    	<span th:if="${#strings.length(demand.demandName) > 25}">
											        	<span th:text="${#strings.substring(demand.demandName,0,25)+'...'}"></span>
											        </span>
											        <span th:unless="${#strings.length(demand.demandName) > 25}">
											        	<span th:text="${demand.demandName}"></span>
											        </span>
											        <div class="box-tools pull-right" th:if="${#strings.length(demand.demandName) > 25}">
											        	<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i></button>
											        </div>
										       	</div>
										        <div class="box-body" style="display: none;">
										            <span th:text="${demand.demandName}"></span>
										        </div>
									    	</div>
								        </div>
                                    </td>
                                    <td th:text="${demand.demandType}"></td>
                                    <td th:text="${demand.demandStatus}"></td>
									<td>
										<a th:href="@{'/person/personDetails?pid='+${demand.demandContactId == null ? '' : demand.demandContactId}}" 
										   th:text="${demand.demandContactName == null ? '' : demand.demandContactName}">联系人</a>
									</td>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
				<!-- 按钮 -->
				<div style="width:800px; height: 30px; position:fixed;left:580px;bottom:10px;">
					<button type="button" class="btn btn-primary" onclick="window.history.go(-1)" style="margin-left: 15px;">返回</button>
					<a class="btn btn-primary" style="margin-left: 15px;" th:href="@{/person/updateView(pid=${person.pid})}">修改</a>
                   	<a class="btn btn-primary" style="margin-left: 15px;" th:href="@{/person/mateConference(pid=${person.pid})}">参会</a>
                   	<a class="btn btn-primary" style="margin-left: 15px;" href="javascirpt:void(0)" 
                   			  th:onclick="'javascript:subscribe(\''+${person.pid}+'\',4)'">关注</a>
                   	<a class="btn btn-primary" style="margin-left: 15px;" th:href="@{'/person/mateDemandView?pid='+${person.pid}+
                   			 '&expertNumber='+${person.expertNumber}+'&name='+${person.name}}">匹配需求</a>
                   	<a class="btn btn-primary" style="margin-left: 15px;" th:href="@{/person/findButtDetailsList(pid=${person.pid})}">匹配需求详情</a>
				</div>
			</section>
			<!-- 置顶按钮 -->
			<a href="#0" class="cd-top">Top</a>
		</div><!-- 右侧修改功能结束 -->
		
		<!-- 引入页脚 -->
		<div th:replace="footer::html"></div>
		<div class="control-sidebar-bg"></div> 
	</div>

	<!-- 引入js -->
	<div th:replace="bottom::html" ></div>
</body>
	<script type="text/javascript"  th:inline="javascript">
		//匹配  异步请求没有刷新页面  当匹配成功后需刷新才能看到匹配详情
		matchButt([[@{/person/pipei}]]);	
	
		/* $(document).ready(function() {
			//隐藏固定电话后四位
			var fixedPhone = $('#fixedPhone').text();
			if(fixedPhone !== undefined && fixedPhone !== null)
			var mfixedPhone = fixedPhone.substr(0, fixedPhone.length-4) + '****';   
			$('#fixedPhone').text(mfixedPhone)
			
			//隐藏手机后四位
			var tell = $('#tell').text();
			if(tell !== undefined && tell !== null)
			var mtell = tell.substr(0, tell.length-4) + '****';   
			$('#tell').text(mtell)
			
			//隐藏邮箱前四位
			var email = $('#email').text(); 
			if(email !== undefined && email !== null)
			var memail = '****' + email.substr(4, email.length);   
			$('#email').text(memail) 
			
			//隐藏微信后四位
			var wechat = $('#wechat').text();  
			if(wechat !== undefined && wechat !== null)
			var mwechat = wechat.substr(0, wechat.length-4) + '****';   
			$('#wechat').text(mwechat)
			
			//隐藏其他联系方式后四位
			var otherContact = $('#otherContact').text();  
			if(otherContact !== undefined && otherContact !== null)
			var motherContact = otherContact.substr(0, otherContact.length-4) + '****';   
			$('#otherContact').text(motherContact)
		}); */
	</script>
</html>